import {
  Column,
  CreateDateColumn,
  Entity,
  JoinTable,
  ManyToMany,
  ManyToOne,
  OneToOne,
  PrimaryGeneratedColumn,
  UpdateDateColumn,
} from 'typeorm';
import { Enterprise } from './enterprise.entity';
@Entity({ name: 'executive' })
export class Executive {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({
    length: 255,
    comment: '姓名',
  })
  name: string;

  @Column({
    length: 255,
    comment: '头像',
    // default: '/uploads/default-avatar.png',
    nullable: true,
  })
  photo: string;

  @Column({
    length: 255,
    comment: '学历',
  })
  education: string;

  @Column({
    length: 255,
    comment: '职位',
  })
  position: string;

  @CreateDateColumn({ type: 'timestamp', comment: '创建时间' })
  createTime: Date;

  @UpdateDateColumn({ type: 'timestamp', comment: '更新时间' })
  updateTime: Date;

  @ManyToOne(() => Enterprise, (enterprise) => enterprise.patents, {
    onDelete: 'CASCADE',
    onUpdate: 'CASCADE',
  })
  enterprise: Enterprise;
}
